package org.atoral.oralarithmetic.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
// 日志注解
@Slf4j
@RestController
public class HelloController {
    @Autowired
    StringRedisTemplate redisTemplate;
    @GetMapping("/hello")
    public String hello(String str) {
        // 打印日志
        Logger logger = LoggerFactory.getLogger(getClass());
        logger.info("请求hello方法");
        // 导入日志注解后可以使用
        log.trace("这是个trace");
        log.debug("这是个debug");
        log.info("我喜欢你");
        log.warn("这是个warn");
        log.error("这是个error{}", str);

        return "hello world";
    }
}
